change group owner from 'manager' to 'user'

This will allow privacy management to use existing code.
Some template updates also are for rationalising how
groups are created and edited.
This commit is contained in:
Hugh Rundle
2021-09-27 15:36:41 +10:00
parent 2874e52309
commit f3181690a2
10 changed files with 17 additions and 12 deletions

View File

@ -1,6 +1,6 @@
{% load i18n %}
{% spaceless %}
{% blocktrans with username=group.manager.display_name path=group.manager.local_path %}Managed by <a href="{{ path }}">{{ username }}</a>{% endblocktrans %}
{% blocktrans with username=group.user.display_name path=group.user.local_path %}Managed by <a href="{{ path }}">{{ username }}</a>{% endblocktrans %}
{% endspaceless %}

View File

@ -5,7 +5,7 @@
<div class="columns">
<div class="column is-two-thirds">
<input type="hidden" name="manager" value="{{ request.user.id }}" />
<input type="hidden" name="user" value="{{ request.user.id }}" />
<input type="hidden" name="privacy" value="public" />
<div class="field">
<label class="label" for="id_name">{% trans "Group Name:" %}</label>
@ -20,9 +20,9 @@
<div class="columns is-mobile">
<div class="column">
<div class="field has-addons">
<!-- <div class="control">
<div class="control">
{% include 'snippets/privacy_select.html' with current=group.privacy %}
</div> -->
</div>
<div class="control">
<button type="submit" class="button is-primary">{% trans "Save" %}</button>
</div>

View File

@ -12,7 +12,7 @@
</p>
</div>
<div class="column is-narrow is-flex">
{% if request.user == group.manager %}
{% if request.user == group.user %}
{% trans "Edit group" as button_text %}
{% include 'snippets/toggle/open_button.html' with text=button_text icon_with_text="pencil" controls_text="edit_group" focus="edit_group_header" %}
{% endif %}

View File

@ -38,7 +38,7 @@
<span title="{{ member.display_name }}" class="is-block is-6 has-text-weight-bold">{{ member.display_name|truncatechars:10 }}</span>
<span title="@{{ member|username }}" class="is-block pb-3">@{{ member|username|truncatechars:8 }}</span>
</a>
{% if group.manager == member %}
{% if group.user == member %}
<span class="icon icon-star-full" title="Manager">
<span class="is-sr-only">Manager</span>
</span>

View File

@ -8,7 +8,7 @@
<div class="card is-stretchable">
<header class="card-header">
<h4 class="card-header-title">
<a href="{{ group.local_path }}">{{ group.name }}</a> <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=group %}</span>
<a href="/group/{{ group.id }}">{{ group.name }}</a> <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=group %}</span>
</h4>
{% if request.user.is_authenticated and request.user|saved:list %}
<div class="card-header-icon">