mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-13 14:30:17 +02:00
make description a real description
textfield instead of charfield. a bit more user friendly in the backend
This commit is contained in:
parent
87c0c3ac73
commit
603bd9c37c
@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 3.1.2 on 2020-10-25 11:09
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("groupmanagement", "0014_auto_20200918_1412"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="authgroup",
|
||||||
|
name="description",
|
||||||
|
field=models.TextField(
|
||||||
|
blank=True,
|
||||||
|
help_text="Short description <i>(max. 512 characters)</i> of the group shown to users.",
|
||||||
|
max_length=512,
|
||||||
|
null=True,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
@ -55,7 +55,6 @@ class RequestLog(models.Model):
|
|||||||
return user.profile.main_character
|
return user.profile.main_character
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AuthGroup(models.Model):
|
class AuthGroup(models.Model):
|
||||||
"""
|
"""
|
||||||
Extends Django Group model with a one-to-one field
|
Extends Django Group model with a one-to-one field
|
||||||
@ -76,46 +75,75 @@ class AuthGroup(models.Model):
|
|||||||
Open - Users are automatically accepted into the group
|
Open - Users are automatically accepted into the group
|
||||||
Not Open - Users requests must be approved before they are added to the group
|
Not Open - Users requests must be approved before they are added to the group
|
||||||
"""
|
"""
|
||||||
|
|
||||||
group = models.OneToOneField(Group, on_delete=models.CASCADE, primary_key=True)
|
group = models.OneToOneField(Group, on_delete=models.CASCADE, primary_key=True)
|
||||||
|
|
||||||
internal = models.BooleanField(default=True,
|
internal = models.BooleanField(
|
||||||
help_text="Internal group, users cannot see, join or request to join this group.<br>"
|
default=True,
|
||||||
"Used for groups such as Members, Corp_*, Alliance_* etc.<br>"
|
help_text="Internal group, users cannot see, join or request to join this group.<br>"
|
||||||
"<b>Overrides Hidden and Open options when selected.</b>")
|
"Used for groups such as Members, Corp_*, Alliance_* etc.<br>"
|
||||||
hidden = models.BooleanField(default=True,
|
"<b>Overrides Hidden and Open options when selected.</b>",
|
||||||
help_text="Group is hidden from users but can still join with the correct link.")
|
)
|
||||||
open = models.BooleanField(default=False,
|
|
||||||
help_text="Group is open and users will be automatically added upon request. <br>"
|
hidden = models.BooleanField(
|
||||||
"If the group is not open users will need their request manually approved.")
|
default=True,
|
||||||
public = models.BooleanField(default=False,
|
help_text="Group is hidden from users but can still join with the correct link.",
|
||||||
help_text="Group is public. Any registered user is able to join this group, with "
|
)
|
||||||
"visibility based on the other options set for this group.<br> Auth will "
|
|
||||||
"not remove users from this group automatically when they are no longer "
|
open = models.BooleanField(
|
||||||
"authenticated.")
|
default=False,
|
||||||
|
help_text="Group is open and users will be automatically added upon request. <br>"
|
||||||
|
"If the group is not open users will need their request manually approved.",
|
||||||
|
)
|
||||||
|
|
||||||
|
public = models.BooleanField(
|
||||||
|
default=False,
|
||||||
|
help_text="Group is public. Any registered user is able to join this group, with "
|
||||||
|
"visibility based on the other options set for this group.<br> Auth will "
|
||||||
|
"not remove users from this group automatically when they are no longer "
|
||||||
|
"authenticated.",
|
||||||
|
)
|
||||||
|
|
||||||
# Group leaders have management access to this group
|
# Group leaders have management access to this group
|
||||||
group_leaders = models.ManyToManyField(User, related_name='leads_groups', blank=True,
|
group_leaders = models.ManyToManyField(
|
||||||
help_text="Group leaders can process group requests for this group "
|
User,
|
||||||
"specifically. Use the auth.group_management permission to allow "
|
related_name="leads_groups",
|
||||||
"a user to manage all groups.")
|
blank=True,
|
||||||
|
help_text="Group leaders can process group requests for this group "
|
||||||
|
"specifically. Use the auth.group_management permission to allow "
|
||||||
|
"a user to manage all groups.",
|
||||||
|
)
|
||||||
|
|
||||||
# allow groups to be *group leads*
|
# allow groups to be *group leads*
|
||||||
group_leader_groups = models.ManyToManyField(Group, related_name='leads_group_groups', blank=True,
|
group_leader_groups = models.ManyToManyField(
|
||||||
help_text="Group leaders can process group requests for this group "
|
Group,
|
||||||
"specifically. Use the auth.group_management permission to allow "
|
related_name="leads_group_groups",
|
||||||
"a user to manage all groups.")
|
blank=True,
|
||||||
|
help_text="Group leaders can process group requests for this group "
|
||||||
|
"specifically. Use the auth.group_management permission to allow "
|
||||||
|
"a user to manage all groups.",
|
||||||
|
)
|
||||||
|
|
||||||
states = models.ManyToManyField(State, related_name='valid_states', blank=True,
|
states = models.ManyToManyField(
|
||||||
help_text="States listed here will have the ability to join this group provided "
|
State,
|
||||||
"they have the proper permissions.")
|
related_name="valid_states",
|
||||||
|
blank=True,
|
||||||
|
help_text="States listed here will have the ability to join this group provided "
|
||||||
|
"they have the proper permissions.",
|
||||||
|
)
|
||||||
|
|
||||||
description = models.CharField(max_length=512, blank=True, help_text="Description of the group shown to users.")
|
description = models.TextField(
|
||||||
|
max_length=512,
|
||||||
|
null=True,
|
||||||
|
blank=True,
|
||||||
|
help_text="Short description <i>(max. 512 characters)</i> of the group shown to users.",
|
||||||
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.group.name
|
return self.group.name
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = (
|
permissions = (("request_groups", u"Can request non-public groups"),)
|
||||||
("request_groups", u"Can request non-public groups"),
|
|
||||||
)
|
|
||||||
default_permissions = tuple()
|
default_permissions = tuple()
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<th>{% trans "Description" %}</th>
|
<th>{% trans "Description" %}</th>
|
||||||
<th>{% trans "Status" %}</th>
|
<th>{% trans "Status" %}</th>
|
||||||
<th>{% trans "Member Count" %}</th>
|
<th>{% trans "Member Count" %}</th>
|
||||||
<th></th>
|
<th style="min-width: 170px;"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@ -36,7 +36,7 @@
|
|||||||
<a href="{% url 'groupmanagement:membership' group.id %}">{{ group.name }}</a>
|
<a href="{% url 'groupmanagement:membership' group.id %}">{{ group.name }}</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>{{ group.authgroup.description }}</td>
|
<td>{{ group.authgroup.description|linebreaks|urlize }}</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
{% if group.authgroup.hidden %}
|
{% if group.authgroup.hidden %}
|
||||||
@ -64,7 +64,6 @@
|
|||||||
<a id="clipboard-copy" data-clipboard-text="{{ request.scheme }}://{{request.get_host}}{% url 'groupmanagement:request_add' group.id %}" class="btn btn-warning" title="{% trans "Copy Direct Join Link" %}">
|
<a id="clipboard-copy" data-clipboard-text="{{ request.scheme }}://{{request.get_host}}{% url 'groupmanagement:request_add' group.id %}" class="btn btn-warning" title="{% trans "Copy Direct Join Link" %}">
|
||||||
<i class="glyphicon glyphicon-copy"></i>
|
<i class="glyphicon glyphicon-copy"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
{% for g in groups %}
|
{% for g in groups %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ g.group.name }}</td>
|
<td>{{ g.group.name }}</td>
|
||||||
<td>{{ g.group.authgroup.description|urlize }}</td>
|
<td>{{ g.group.authgroup.description|linebreaks|urlize }}</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% if g.group in user.groups.all %}
|
{% if g.group in user.groups.all %}
|
||||||
{% if not g.request %}
|
{% if not g.request %}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
<li class="active">
|
<li class="active">
|
||||||
<a data-toggle="tab" href="#add">
|
<a data-toggle="tab" href="#add">
|
||||||
{% trans "Join Requests" %}
|
{% trans "Join Requests" %}
|
||||||
|
|
||||||
{% if acceptrequests %}
|
{% if acceptrequests %}
|
||||||
<span class="badge">{{ acceptrequests|length }}</span>
|
<span class="badge">{{ acceptrequests|length }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -31,6 +32,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<a data-toggle="tab" href="#leave">
|
<a data-toggle="tab" href="#leave">
|
||||||
{% trans "Leave Requests" %}
|
{% trans "Leave Requests" %}
|
||||||
|
|
||||||
{% if leaverequests %}
|
{% if leaverequests %}
|
||||||
<span class="badge">{{ leaverequests|length }}</span>
|
<span class="badge">{{ leaverequests|length }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -131,7 +133,7 @@
|
|||||||
</a><br>
|
</a><br>
|
||||||
{{ leaverequest.main_char.alliance_name|default_if_none:"" }}
|
{{ leaverequest.main_char.alliance_name|default_if_none:"" }}
|
||||||
{% else %}
|
{% else %}
|
||||||
(unknown)
|
{% trans "(unknown)" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ leaverequest.group.name }}</td>
|
<td>{{ leaverequest.group.name }}</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user