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

Hide checkboxes in archived locations for observer role #3296

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

lunars97
Copy link
Contributor

Short description

This is the follow up implementation of the #3014 During the implementation I forgot to remove checkboxes for archived locations as well.

Proposed changes

  • Remove checkboxes for observer role in archived locations

Side effects

  • none

Resolved issues

Fixes: #3262


Pull Request Review Guidelines

Copy link
Contributor

@JoeyStk JoeyStk left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. I have one thought on the implementation. I think it's a good thing that you stuck with the implementation as we have it in the other templates. However, I can see one problem we might want to think about :) Let me know what you think :)

value="{{ poi.id }}"
form="bulk-action-form"
class="bulk-select-item" />
{% if perms.cms.change_poi %}
Copy link
Contributor

Choose a reason for hiding this comment

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

This has a small side effect: The rows loses the padding to the top and bottom, and shrinks a little bit (s. screenshot).

Screenshot from 2024-12-17 16-23-12

I'm sure there are better ways to do it, but I couldn't come up with one and wanted to share at least one idea, so here we go :)

I think I would move the permission check one hierarchy up.

Suggested change
{% if perms.cms.change_poi %}
{% if perms.cms.change_poi %}
<td class="py-3 pl-4 pr-2">

and then add to next element the classes in case you can't change the poi (s. below).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JoeyStk thank you for your suggestion :) Unfortunately, if I put it above, the whole row moves on the left side, so I used instead the class option

Copy link
Contributor

Choose a reason for hiding this comment

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

I somehow can't reproduce how it looks in the picture of @JoeyStk (Firefox/Chrome)

value="{{ poi.id }}"
form="bulk-action-form"
class="bulk-select-item" />
{% endif %}
</td>
<td class="pr-2">
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<td class="pr-2">
<td class="pr-2 {% if not perms.cms.change_poi %} py-3 pl-4 pr-2 {% endif %}">

Copy link
Contributor

Choose a reason for hiding this comment

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

If you chose to go with this suggestion, please don't forget to also apply this to the poi_list_archived.html template :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the problem was with the row... so i did not change here anything :)

@lunars97 lunars97 force-pushed the enhancement/hide-checkboxes-in-archived-location-for-observer branch from 98edb0c to d6f4e3b Compare December 17, 2024 17:41
@lunars97 lunars97 requested a review from JoeyStk December 17, 2024 17:49
@lunars97 lunars97 added the effort: low Should be doable in <4h label Dec 18, 2024
Copy link
Contributor

@jarlhengstmengel jarlhengstmengel left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: low Should be doable in <4h
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide checkboxes in archived locations for Observer Userrole
3 participants