Skip to content

Conversation

@5aola
Copy link

@5aola 5aola commented Oct 13, 2025

Issue(s)
#172

Description
Added buttons to delete and archive the message when it's in detailed view.
The features of the buttons are kept original. If the message is deleted, it redirects to the messages list page.

@5aola 5aola changed the title Add delete and archive buttons in messages #172 Add delete and archive buttons in messages Oct 13, 2025
Copy link
Contributor

@Bomme Bomme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @5aola,
many thanks for the PR! Sorry, that it took so long to get it reviewed.
I left a few comments. Let me know if you have any questions!

href=""
data-action-value="a">
{% if message.is_archived %}{% bw_icon "box-remove" %}{% else %}{% bw_icon "box-add" %}{% endif %}
</i>{% if message.is_archived %}Unarchive{% else %}Archive{% endif %}</a>{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing tag </i> matches nothing

class="h-spacing-left-2 btn-inverse no-hover message-action"
href=""
data-action-value="dm">
{% bw_icon "trash" %}</i>Delete</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing tag </i> matches nothing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is a bit hacky and it took me a while to understand why this works.
Maybe it's better to add a form to templates/messages/message.html?

</div>
<div class="col-12">
<div class="v-spacing-top-5 text-center">
<div class="v-spacing-top-5 text-center" data-message-id="{{ message.id }}">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better add a form

{% endblock %}

{% block extrabody %}
<script src="{% static 'bw-frontend/dist/messages.js' %}"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not rely on messages.js here.
A simple form / POST --> to messages-change-state might be cleaner.
See comment above (line 51)

@5aola
Copy link
Author

5aola commented Nov 28, 2025

Thanks for the feedback. My initial thinking was just to recreate a very similar behavior to the other delete and archive buttons at display_message.html, but it makes sense to just use forms POST call to trigger the original
messages-change-state function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants