1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

Tweaked trust back display

This commit is contained in:
Nicolas Margulies 2022-09-28 10:28:47 +02:00
parent 6a69590a82
commit d81b1f2710
2 changed files with 6 additions and 5 deletions

View File

@ -36,7 +36,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<div class="card bg-light mb-3"> <div class="card bg-light mb-3">
<h3 class="card-header text-center"> <h3 class="card-header text-center">
{% trans "People trusting you" %} {% trans "People having you as a friend" %}
</h3> </h3>
{% render_table trusted_by %} {% render_table trusted_by %}
</div> </div>

View File

@ -183,14 +183,15 @@ class TrustedTable(tables.Table):
template_name = "django_tables2/bootstrap4.html" template_name = "django_tables2/bootstrap4.html"
show_header = False show_header = False
trusting = tables.Column(attrs={'td': {'class': 'text-center'}}) trusting = tables.Column(attrs={
'td': {'class': 'text-center', 'width':'100%'}})
trust_back = tables.Column( trust_back = tables.Column(
verbose_name=_("Trust back"), verbose_name=_("Trust back"),
accessor="pk", accessor="pk",
attrs={ attrs={
'td': { 'td': {
'class': 'col-sm-1', 'class': '',
'id': lambda record: "trust_back_" + str(record.pk), 'id': lambda record: "trust_back_" + str(record.pk),
} }
}, },
@ -203,10 +204,10 @@ class TrustedTable(tables.Table):
return "" return ""
val = '<button id="' val = '<button id="'
val += str(record.pk) val += str(record.pk)
val += '" class="btn btn-success btn-sm" \ val += '" class="btn btn-success btn-sm text-nowrap" \
onclick="create_trust(' + str(record.trusted.pk) + ',' + \ onclick="create_trust(' + str(record.trusted.pk) + ',' + \
str(record.trusting.pk) + ')">' str(record.trusting.pk) + ')">'
val += str(_("Trust back")) val += str(_("Add back"))
val += '</button>' val += '</button>'
return mark_safe(val) return mark_safe(val)