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

Added permission groups to user management page in console #2113

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

mscanlan-git
Copy link
Contributor

This PR addresses #2105 by adding a permissions group section on the user's page in the console.

Currently, the template is set up to list "no group" if the user does not have any group affiliations, however, I'm open to suggestions on maybe hiding the section entirely if the user has no group affiliation.

@mscanlan-git mscanlan-git changed the title Added group affiliation to user mgmt page Added permission groups to user management page in console Oct 17, 2023
Copy link
Member

@tompollard tompollard 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, thanks Michael. I added a few very minor comments inline!

{% for group in groups %}
<ul><li><a href="{% url 'user_group' group.name %}">{{ group.name }}</a></li></ul>
{% empty %}
<ul><li>No Groups</li></ul>
Copy link
Member

Choose a reason for hiding this comment

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

It feels slightly unnecessary to have a "No groups" bullet here. Could we instead say The user is a member of the following groups:... if there is one or more groups and something like The user does not belong to a permission group. if not?

Copy link
Member

@tompollard tompollard Oct 18, 2023

Choose a reason for hiding this comment

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

We now have:

      <div class="col-md-9">
        <ul>
        {% for group in groups %}
            <li><a href="{% url 'user_group' group.name %}">{{ group.name }}</a></li>
        {% empty %}
            The user does not belong to a permission group.
        {% endfor %}
        </ul>
      </div>

For people who aren't in a group, this step will output The user does not belong to a permission group. inside <ul> tags which I think isn't quite right. I haven't tested, but what about something like this:

  <br />
  <h3>Permission groups</h3>
  <hr>
    <div class="row mb-1">
      {% if groups %}
        <div class="col-md-6">
          The user is a member of the following groups:
        </div>
        <div class="col-md-9">
          <ul>
          {% for group in groups %}
              <li><a href="{% url 'user_group' group.name %}">{{ group.name }}</a></li>
          {% endfor %}
          </ul>
        </div>
      {% else %}
          <div class="col-md-6">
            The user does not belong to a permission group.
          </div>
      {% endif %}
    </div>

Copy link
Contributor Author

@mscanlan-git mscanlan-git Oct 19, 2023

Choose a reason for hiding this comment

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

I switched over to the new format, it made the else statement make more sense by not including the <ul> tag

@tompollard
Copy link
Member

thanks, looks good to me!

@tompollard tompollard merged commit f718cb6 into dev Oct 19, 2023
8 checks passed
@tompollard tompollard deleted the group-membership branch October 19, 2023 20:47
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