Commit 01722e4d authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Additional confirm widgets for join/leave actions

Also deny GET requests for those actions
parent 03a8a1f0
......@@ -41,10 +41,10 @@
{% endif %}
{% if can_join_request %}
<a class="user-action" href="{% url astakos.im.views.project_join project.pk %}">JOIN</a>
{% confirm_link "JOIN" "project_join" "project_join" project.pk %}
{% endif %}
{% if can_leave_request %}
<a class="user-action" href="{% url astakos.im.views.project_leave project.pk %}">LEAVE</a>
{% confirm_link "LEAVE" "project_leave" "project_leave" project.pk %}
{% endif %}
</div>
......@@ -226,12 +226,12 @@ CONFIRM_LINK_PROMPT_MAP = {
'project_app_deny': _('Are you sure you want to deny this project ? '
'<br /><br />You '
'may optionally provide denial reason in the '
'following field: <br /><br /><textarea class="deny_reason" '
'name="reason"></textarea>'),
'following field: <br /><br /><textarea '
'class="deny_reason" name="reason"></textarea>'),
'project_app_dismiss': _('Are you sure you want to dismiss this '
'project ?'),
'project_app_join': _('Are you sure you want to join this project ?'),
'project_app_leave': _('Are you sure you want to leave this project ?'),
'project_join': _('Are you sure you want to join this project ?'),
'project_leave': _('Are you sure you want to leave from the project ?'),
}
......
......@@ -1365,7 +1365,7 @@ def project_search(request):
'table': table
})
@require_http_methods(["POST", "GET"])
@require_http_methods(["POST"])
@signed_terms_required
@login_required
@project_transaction_context(sync=True)
......@@ -1393,7 +1393,7 @@ def project_join(request, chain_id, ctx=None):
next = restrict_next(next, domain=COOKIE_DOMAIN)
return redirect(next)
@require_http_methods(["POST", "GET"])
@require_http_methods(["POST"])
@signed_terms_required
@login_required
@project_transaction_context(sync=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment