Revert "Remove unused UserList.addable property."

It turns out it wasn't so unused. :(

This reverts commit 984585d54b681d721d33ec614e9b58ae2f39cf2a.
This commit is contained in:
Max Goodman
2012-10-12 00:22:04 -07:00
parent e191b3866e
commit a84ad12960
3 changed files with 8 additions and 5 deletions

View File

@@ -2810,8 +2810,11 @@ class UserList(Templated):
destination = "friend"
remove_action = "unfriend"
def __init__(self, editable=True):
def __init__(self, editable=True, addable=None):
self.editable = editable
if addable is None:
addable = editable
self.addable = addable
Templated.__init__(self)
def user_row(self, row_type, user, editable=True):
@@ -2894,8 +2897,8 @@ class EnemyList(UserList):
type = 'enemy'
cells = ('user', 'remove')
def __init__(self, editable=True):
UserList.__init__(self, editable)
def __init__(self, editable=True, addable=False):
UserList.__init__(self, editable, addable)
@property
def table_title(self):

View File

@@ -52,7 +52,7 @@
%if thing.can_force_add:
${add_form(thing.form_title, thing.destination, thing.type, thing.container_name)}
%endif
%if thing.editable:
%if thing.addable:
<%call expr="add_form(thing.invite_form_title, thing.destination, thing.invite_type, thing.container_name, verb=_('invite'))">
${error_field("ALREADY_MODERATOR", "name")}
</%call>

View File

@@ -69,7 +69,7 @@
</%def>
<div class="${thing._class} usertable">
%if thing.editable:
%if thing.addable:
${add_form(thing.form_title, thing.destination, thing.type, thing.container_name)}
%endif