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

Add "Edit sound description" button to tickets for uploaders #1774

Closed
qubodup opened this issue May 31, 2024 · 1 comment
Closed

Add "Edit sound description" button to tickets for uploaders #1774

qubodup opened this issue May 31, 2024 · 1 comment

Comments

@qubodup
Copy link

qubodup commented May 31, 2024

Whenever a moderator asks a user in a ticket to make changes to the title/tags/description, a substantial number of uploaders doesn't know how to. The path to get there is somewhat cumbersome:

  1. Click the normal sized black sound title
  2. Click Edit sound description

When it could be reduced to one step.

This is what a ticket looks like for a moderator:

image

This is what a ticket looks like for an affected uploader:

image

This is my suggested change for an affected uploader:

image

(the edit sound description button was added. It is identical to the one on a sound page:

image

This would also eliminate the need for an externally image showing how to edit sound details via an ad-loaded 3rd party site or having to manage an additional annotated screenshot hosted on freesound. ( #1765 )

Here is the code on a sound page (

<a class="no-hover btn-secondary display-inline-block w-100 text-center v-spacing-top-3" href="{% url 'sound-edit' sound.user.username sound.id %}">Edit sound description</a>
):

<a class="no-hover btn-secondary display-inline-block w-100 text-center v-spacing-top-3" href="{% url 'sound-edit' sound.user.username sound.id %}">Edit sound description</a>

This button should be displayed instead of <div class="v-spacing-top-2 text-grey"> You do not have permissions to perform any actions. </div> if the following are true:

  • The page is viewed by the user who created the sound ({% if ticket.sender.id == user.id %} might do the trick)
  • The sound is not deleted ({% if sound is not None %} might do the trick)
  • Perhaps other factors that might prohibit editing need to be excluded. If so, hopefully {% if sound.processing_state == 'OK' %} would work, which comes from
    {% if sound.processing_state == 'OK' %}

I found these variables on the ticket and sound pages. I don't know if all of them area available on the ticket page.

The affected file is https://github.com/MTG/freesound/blob/master/templates/moderation/ticket.html

I suppose an else if that chains the above conditions together should be inserted before

{% else %}
<div class="v-spacing-top-2 text-grey">
You do not have permissions to perform any actions.
</div>
{% endif %}

@ffont
Copy link
Member

ffont commented Oct 15, 2024

Thanks for the nice ticket description, I made an implementation in commit a4f5163 which should work, I'll merge soonish.

@ffont ffont closed this as completed Oct 15, 2024
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

No branches or pull requests

2 participants