Skip to content

Commit

Permalink
✨ Allow new mail upload for all users
Browse files Browse the repository at this point in the history
  • Loading branch information
pajowu committed Nov 12, 2024
1 parent f0e317d commit 6bb323b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 deletions.
6 changes: 3 additions & 3 deletions froide/foirequest/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def trigger_index_update(klass, instance_pk):
def send_notification_became_overdue(sender, **kwargs):
req_url = sender.user.get_autologin_url(sender.get_absolute_short_url())
upload_url = sender.user.get_autologin_url(
short_request_url("foirequest-upload_postal_message", sender)
short_request_url("foirequest-upload_postal_message_create", sender)
)
send_request_user_email(
became_overdue_email,
Expand All @@ -99,7 +99,7 @@ def send_notification_became_overdue(sender, **kwargs):
def send_notification_became_asleep(sender, **kwargs):
req_url = sender.user.get_autologin_url(sender.get_absolute_short_url())
upload_url = sender.user.get_autologin_url(
short_request_url("foirequest-upload_postal_message", sender)
short_request_url("foirequest-upload_postal_message_create", sender)
)

send_request_user_email(
Expand Down Expand Up @@ -488,7 +488,7 @@ def send_foimessage_sent_confirmation(message: FoiMessage = None, **kwargs):
action_url = message.get_absolute_domain_short_url()

upload_url = request.user.get_autologin_url(
short_request_url("foirequest-upload_postal_message", request)
short_request_url("foirequest-upload_postal_message_create", request)
)

context = {
Expand Down
31 changes: 5 additions & 26 deletions froide/foirequest/templates/foirequest/body/body.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,11 @@
<i class="fa fa-send" aria-hidden="true"></i>
<span class="d-none d-sm-inline">{% trans "Send message" %}</span>
</a>
{% if request.user.is_staff %}
<a href="{% url "foirequest-upload_postal_message_create" slug=object.slug %}"
class="btn btn-primary btn-sm upload-post-link">
<i class="fa fa-envelope" aria-hidden="true"></i>
<span>{% trans "Upload Mail" %}</span>
</a>
{% else %}
<a href="{% url "foirequest-upload_postal_message" slug=object.slug %}"
class="btn btn-primary btn-sm upload-post-link">
<i class="fa fa-envelope" aria-hidden="true"></i>
<span>{% trans "Upload Mail" %}</span>
</a>
{% endif %}
<a href="{% url "foirequest-upload_postal_message_create" slug=object.slug %}"
class="btn btn-primary btn-sm upload-post-link">
<i class="fa fa-envelope" aria-hidden="true"></i>
<span>{% trans "Upload Mail" %}</span>
</a>
{% endif %}
{% with hide_label=object|can_write_foirequest:request %}
<a href="#" class="btn btn-outline-secondary btn-sm js-trigger-expand-all-messages ms-auto" title="{% trans "Expand/collapse all" %}">
Expand Down Expand Up @@ -68,19 +60,6 @@
<i class="fa fa-envelope" aria-hidden="true"></i>
<span>{% trans "Upload Mail" %}</span>
</a>
{% comment %}
<div class="mt-1 d-flex justify-content-center">
<div class="dropdown flex-shrink-1">
<button id="otherReplyActions" type="button" class="btn btn-link text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<strong>{% trans "Other Options" %}</strong>
</button>
<div class="dropdown-menu alpha-dropdown-menu" aria-labelledby="otherReplyActions">
<a class="dropdown-item" href="#">Action 1</a>
<a class="dropdown-item" href="#">Action 2</a>
</div>
</div>
</div>
{% endcomment %}
</div>
{% endif %}
</div>
Expand Down

0 comments on commit 6bb323b

Please sign in to comment.