From a84ad12960c6340c79854ffdb8d9a89487c30bba Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Fri, 12 Oct 2012 00:22:04 -0700 Subject: [PATCH] Revert "Remove unused UserList.addable property." It turns out it wasn't so unused. :( This reverts commit 984585d54b681d721d33ec614e9b58ae2f39cf2a. --- r2/r2/lib/pages/pages.py | 9 ++++++--- r2/r2/templates/modlist.html | 2 +- r2/r2/templates/userlist.html | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index fd008433d..6f6674799 100755 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -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): diff --git a/r2/r2/templates/modlist.html b/r2/r2/templates/modlist.html index 41337f5a2..b995b7842 100644 --- a/r2/r2/templates/modlist.html +++ b/r2/r2/templates/modlist.html @@ -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")} diff --git a/r2/r2/templates/userlist.html b/r2/r2/templates/userlist.html index ad647f5a1..b083a4b88 100644 --- a/r2/r2/templates/userlist.html +++ b/r2/r2/templates/userlist.html @@ -69,7 +69,7 @@
- %if thing.editable: + %if thing.addable: ${add_form(thing.form_title, thing.destination, thing.type, thing.container_name)} %endif